const { findMovieRoles } = require('./data/movie-roles')
const Mock = require('mockjs')

const base = '/movieserver'

module.exports = [{
  url: `${base}/playRoleInstances/movie/[1-9][0-9]*/v/*/file`,
  type: 'get',
  response: Mock.Random.image()
}, {
  url: `${base}/playRoleInstances/movie/[1-9][0-9]*/v/*`,
  type: 'get',
  response: config => {
    const id = config.url.match(/[1-9][0-9]*/)
    return { success: true, data: findMovieRoles(id, '') }
  }
}]
